package com.dap.dubbo.rpc.config;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.google.common.util.concurrent.RateLimiter;

@JsonIgnoreProperties(value={"rateLimiter"})
public class ParamConfig {
    /**
     * 等待、或者拒绝，降级
     */
    private String strategy="reject";

    /**
     * 每秒钟放置令牌数
     */
    private Integer token=100;

    /**
     * 获取令牌等待时间
     */
    private Integer timeout=10;

    /**
     * 降级方法
     */
    private String  fallback="return null";

    /**
     * 限流桶
     */
    private RateLimiter rateLimiter;


    public RateLimiter getRateLimiter() {
        return rateLimiter;
    }

    public void setRateLimiter(RateLimiter rateLimiter) {
        this.rateLimiter = rateLimiter;
    }

    public String getStrategy() {
        return strategy;
    }

    public void setStrategy(String strategy) {
        this.strategy = strategy;
    }

    public Integer getToken() {
        return token;
    }

    public void setToken(Integer token) {
        this.token = token;
    }

    public Integer getTimeout() {
        return timeout;
    }

    public void setTimeout(Integer timeout) {
        this.timeout = timeout;
    }

    public String getFallback() {
        return fallback;
    }

    public void setFallback(String fallback) {
        this.fallback = fallback;
    }
}
